﻿Imports System.Data.OleDb
Public Class añadirProducto_Admin

    Private Sub PRODUCTOBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PRODUCTOBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.PRODUCTOBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.ScrumDataSet)

    End Sub

    Private Sub añadirProducto_Admin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: esta línea de código carga datos en la tabla 'ScrumDataSet.PRODUCTO' Puede moverla o quitarla según sea necesario.
        Me.PRODUCTOTableAdapter.Fill(Me.ScrumDataSet.PRODUCTO)

    End Sub

    Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click

    End Sub

    Private Sub btnAñadir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAñadir.Click

        'Dim connetionString As String
        'Dim cnn As OleDbConnection
        'connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yourdatabasename.mdb;"
        'cnn = New OleDbConnection(connetionString)
        'Try
        '    cnn.Open()
        '    MsgBox("Connection Open ! ")
        '    cnn.Close()
        'Catch ex As Exception
        '    MsgBox("Can not open connection ! ")
        'End Try

        Dim prod As New Producto(NombreTextBox.Text, PrecioTextBox.Text, DescripcionTextBox.Text)
        'admin.AñadirProducto(prod)
    End Sub
End Class